<template>
  <div class="index-picture">
    <h1 id="title">文章精选</h1>

    <div class="part1">
      <div class="d1">
        <img
          id="pic"
          src="/index-floor/index_art1.jpg"
          alt=""
          style="width: 100%; height: auto"
        />
        <div class="art" v-for="n in news_1" :key="n.artid">
          <router-link :to="'/article?artid=' + n.artid">
            <div class="title">{{ n.title }}</div>
            <div class="sketch">{{ n.sketch }}</div>
          </router-link>
        </div>
      </div>
      <div class="d2">
        <img
          id="pic"
          src="/index-floor/index_art2.jpg"
          alt=""
          style="width: 100%; height: auto"
        />
        <div class="art" v-for="n in news_1" :key="n.artid">
          <router-link :to="'/article?artid=' + n.artid">
            <div class="title">{{ n.title }}</div>
            <div class="sketch">{{ n.sketch }}</div>
          </router-link>
        </div>
      </div>
      <div class="d3">
        <img
          id="pic"
          src="/index-floor/index_art3.jpg"
          alt=""
          style="width: 100%; height: auto"
        />
        <div class="art" v-for="n in news_1" :key="n.artid">
          <router-link :to="'/article?artid=' + n.artid">
            <div class="title">{{ n.title }}</div>
            <div class="sketch">{{ n.sketch }}</div>
          </router-link>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { articleServe } from "@/utils/service/user";
export default {
  data() {
    return {
      news_1: [],
    };
  },
  async mounted() {
    let res = await articleServe(1, 5);
    this.news_1 = res.data;
  },
};
</script>

<style lang="scss" scoped>
.index-picture {
  margin: 0 auto;
  width: 1440px;
  font-size: 300px;
  color: brown;
}

#title {
  font-size: 25%;
  margin: 100px 0;
}
.art {
  padding: 10px;
  border-bottom: 1px dashed #fc9ab2;
  > .title {
    font-size: 25px;
  }
}
.part1 {
  margin: 0 auto;
  width: 1440px;
  display: flex;
}

.d1,
.d2 {
  width: 380px;
  // height: 380px;
  margin-right: 150px;
}

.d3 {
  width: 380px;
  // height: 380px;
}
</style>
